# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-mongomock
pkgver=4.0.0
pkgrel=2
pkgdesc="Fake pymongo stub for testing simple MongoDB-dependent code"
url="https://github.com/mongomock/mongomock"
license=('BSD')
arch=('any')
depends=('python-sentinels' 'python-six' 'python-packaging')
makedepends=('python-pbr')
checkdepends=('python-nose')
source=("https://github.com/mongomock/mongomock/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('52bb91389d44780f76616adb6a956f9f866a090851a7e004d07310e45d4ede858f4bdba6f86b06c5ffad02097b009e675daee49da7eb9c683a2232cef2064d65')

export PBR_VERSION=$pkgver

build() {
  cd mongomock-$pkgver
  python setup.py build
}

check() {
  cd mongomock-$pkgver
  python setup.py nosetests
}

package_python-mongomock() {
  cd mongomock-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
